package com.hui.mapper;

import com.hui.entity.Manager;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 *
 */
public class ManagerMapper implements RowMapper<Manager> {
    @Override
    public Manager rowToEntity(ResultSet rs) {
        Manager manager = null;
        try {

            int marId = rs.getInt("mgr_id");
            String loginName = rs.getString("login_name");
            String loginPwd = rs.getString("login_pwd");
            String marName = rs.getString("mgr_name");
            String marGender = rs.getString("mgr_gender");
            String marTel = rs.getString("mgr_tel");
            String marEmail = rs.getString("mgr_email");
            String marQq = rs.getString("mgr_qq");
            Date createTime = rs.getDate("create_time");

            manager = new Manager(marId, loginName, loginPwd, marName, marGender, marTel, marEmail, marQq, createTime);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return  manager;
    }
}
